// JavaScript Document
window.onload = function() {
                var myinput = document.getElementById('myinput');
                var myspan = document.getElementById('myspan');
                //失去焦点事件
                myinput.onblur = function() {
                    if(!myinput.value || isNaN(myinput.value)) {
                        this.className = 'error'
                        this.title = '请输入此字段'
                        this.focus();
 
                        myspan.style.visibility = 'visible'
                    } else {
                        this.className = 'normal'
                        this.title = ''
 
                        myspan.style.visibility = 'hidden'
                    }
                }
            }